package com.sangmo.fts.process.storage.service;

import com.sangmo.boot.framework.plugin.dataview.crud.service.BaseViewService;
import com.sangmo.boot.framework.plugin.dataview.data.IDataViewRepo;
import com.sangmo.fts.process.storage.model.CsfContractItem;
import com.sangmo.fts.process.storage.repo.CsfContractItemRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class CsfContractItemEntityService extends BaseViewService<CsfContractItem> {

    @Autowired
    private CsfContractItemRepo csfContractItemRepo;

    @Override
    protected IDataViewRepo<CsfContractItem> getRepo() {
        return csfContractItemRepo;
    }

    public List<CsfContractItem> saveAll(List<CsfContractItem> contractItems) {
        return csfContractItemRepo.saveAll(contractItems);
    }

    public List<CsfContractItem> findByContractId(Long contractId) {
        return csfContractItemRepo.findByContractId(contractId);
    }

}
